<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="dictCategoryList" checkbox="false"
  	 fitColumns="true" title="培训报名管理" actionUrl="trainApplyManageController.do?datagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="申请人"  field="applyUser.realName"   query="true" queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="学号"  field="applyUser.staffNo"   query="true" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="班级"  field="applyUser.className"   query="true" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="培训名称"  field="trainItem.id" dictionary="train_item,id,trainning_name"  query="true" queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="实验室"  field="trainItem.lab.name"   query="false" queryMode="single"  width="100"></t:dgCol>
   <t:dgCol title="培训工种"  field="trainItem.teachItem.itemName"   query="false" queryMode="single"  width="60"></t:dgCol>
   <t:dgCol title="报名时间"  field="createDate" formatter="yyyy-MM-dd hh:mm" queryMode="single"  width="100"></t:dgCol>
   <t:dgCol title="在线考试分数"  field="onlineExamScore"   query="false" queryMode="single"  width="70"></t:dgCol>
   <t:dgCol title="线下操作分数"  field="offlineExamScore"   query="false" queryMode="single"  width="70"></t:dgCol>
   <t:dgCol title="是否获取预约资格"  field="isPassed"  formatterjs="getIsPassed"  query="false" queryMode="single"  width="80"></t:dgCol>
    <t:dgCol title="操作" field="opt" width="160"></t:dgCol>
    <t:dgFunOpt  funname="setOfflineScore(id)" title="录入线下考核分数"  />
    <t:dgFunOpt  funname="grantOpenQuality(id)" title="授予开放资格"  exp="isPassed#eq#0"/> 
   </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
 		$("#dictGroupListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
function getPeopleCount(v,rec){
	return rec['enterCount']+"/"+rec['maxEnterCount'];
}
function getIsPassed(v,rec){
	if(1==v){
		return '已获取';
	}else{
		return '未获取';
	}
}



function setOfflineScore(id){
	$.dialog({
		content: 'url:trainApplyManageController.do?goOfflineScore&id='+id,
		lock : true,
		zIndex: getzIndex(),
		width:"450px",
		height:"200px;",
		title:"录入线下操作分数",
		opacity : 0.3,
		fixed:true,
		cache:false,
	    ok: function(){
	    	iframe = this.iframe.contentWindow;
			saveObj();
			return false;
	    },
	    cancelVal: '关闭',
	    cancel: true /*为true等价于function(){}*/
	});
}

function grantOpenQuality(id){
	$.dialog.confirm('确定要授予实验室开放预约资格吗？',function(r){
		if(r){
			$.ajax({
				url:"trainApplyManageController.do?grantQuality&id="+id,
				type:"post",
				success:function(d){
					d = $.parseJSON(d);
					tip(d.msg)
					if(d.success){
						reloadTable();
					}
				}
			});
		}
	});
}

 
 </script>